// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	Vue.prototype.$api={
		//登录
		login: (data = {}) => vm.$u.post('/member/Login/login', data),
		//微信小程序登录
		wxLogin:(data = {}) => vm.$u.post('/member/Login/AppletLogin', data),
		//验证码登录
		codeLogin:(data = {}) => vm.$u.post('/member/Login/codeLogin', data),
		//注册
		register: (data = {}) => vm.$u.post('/member/Login/register', data),
		//验证码接口
		send_sms: (data = {}) => vm.$u.post('/system/Sms/send_sms', data),
		//修改密码
		forgetPass:(data = {}) => vm.$u.post('/member/Login/forgetPass', data),
		// 用户当前信息
		userData:(data = {}) => vm.$u.post('/member/Personal/userData', data),
		//获取配置
		config:(data = {}) => vm.$u.post('/system/Basic/config', data),
		//绑定手机号
		bindMobile:(data = {}) => vm.$u.post('/member/Personal/bindMobile', data),
		//首页轮播图 
		index:(data = {}) => vm.$u.post('/shop/index/index', data),
		//首页广告
		advertisement:(data = {}) => vm.$u.post('/shop/Index/Advertisement', data),
		//首页搜索
		searchIndex:(data = {}) => vm.$u.post('/shop/Index/searchIndex', data),
		
		//商家入驻
		apply_shop:(data = {}) => vm.$u.post('/shop/Shop/apply_shop', data),
		//店铺列表
		get_list:(data = {}) => vm.$u.post('/shop/Shop/get_list', data),
		//店铺详情
		brandDetail:(data = {}) => vm.$u.post('/shop/Shop/detail', data),
		//店铺商品列表:
		brandshopGoods:(data = {}) => vm.$u.post('/shop/Goods/shopGoods', data),
		//当前店铺信息
		getShop:(data = {}) => vm.$u.post('/shop/Shop/getShop', data),
		//获取店铺轮播图
		shopBanner:(data = {}) => vm.$u.post('/shop/Shop/shopBanner', data),
		//修改店铺信息
		editShop:(data = {}) => vm.$u.post('/shop/Shop/editShop', data),
		
		
		//产品中心
		//精选商品
		isLikeGoods:(data = {}) => vm.$u.post('/shop/Goods/isLikeGoods', data),
		//产品中心分类列表
		category:(data = {}) => vm.$u.post('/shop/Category/category', data),
		//产品中心轮播图
		circle_index:(data = {}) => vm.$u.post('/shop/index/circle_index', data),
		//产品中心商品列表
		qualityGoods:(data = {}) => vm.$u.post('/shop/Goods/qualityGoods', data),
		//商品二级分类列表
		categorySon:(data = {}) => vm.$u.post('/shop/Category/categorySon', data),
		//二级分类的商品列表
		qualityGoodsCategory:(data = {}) => vm.$u.post('/shop/Goods/qualityGoodsCategory', data),
		//商品详情
		goodsDetail:(data = {}) => vm.$u.post('/shop/Goods/getGoodsDetail', data),
		//商品收藏/取消 
		goodcollection:(data = {}) => vm.$u.post('/shop/Collection/collection', data),
		//新品发布商品列表 
		recommendGoods:(data = {}) => vm.$u.post('/shop/Goods/recommendGoods', data),
		//新品商品轮播图
		release_index:(data = {}) => vm.$u.post('/shop/index/release_index', data),
		//多规格获取sku
		getSkuBySpece:(data = {}) => vm.$u.post('/shop/Goods/getSkuBySpece', data),
		//添加购物车
		addCart:(data = {}) => vm.$u.post('/shop/Cart/add', data),
		//购物车列表
		getCart_list:(data = {}) => vm.$u.post('/shop/Cart/cart_list', data),
		//删除购物车
		delCart:(data = {}) => vm.$u.post('/shop/Cart/del', data),
		//获取购物车价格
		cart_list_price:(data = {}) => vm.$u.post('/shop/Cart/cart_list_price', data),
		//提交订单
		confirm_order_page:(data = {}) => vm.$u.post('/shop/Order/confirm_order_page', data),
		//购买
		confirm_order:(data = {}) => vm.$u.post('/shop/Order/confirm_order', data),
		//获取店铺支付二维码
		shopPay:(data = {}) => vm.$u.post('/shop/Order/shopPay', data),
		//支付 
		pay:(data = {}) => vm.$u.post('/shop/Order/pay', data),
		
		//我的地址列表
		addlist:(data = {}) => vm.$u.post('/member/Address/get_list', data),
		//新增地址
		addAddress:(data = {}) => vm.$u.post('/member/Address/add', data),
		//编辑地址
		editAdd:(data = {}) => vm.$u.post('/member/Address/edit', data),
		//删除地址
		delAdd:(data = {}) => vm.$u.post('/member/Address/do_delete', data),
		
		
		//获取地址详情
		address_details:(data = {}) => vm.$u.post('/member/Address/address_details', data),
		//获取订单列表
		getorder_list:(data = {}) => vm.$u.post('/shop/Transport/order_list', data),
		//订单详情
		order_detail:(data = {}) => vm.$u.post('/shop/Transport/order_list', data),
		//订单详情
		order_detail:(data = {}) => vm.$u.post('/shop/Transport/order_detail', data),
		//取消订单
		cancel_order:(data = {}) => vm.$u.post('/shop/Transport/cancel_order', data),
		//确认收货
		take_delivery:(data = {}) => vm.$u.post('/shop/Transport/take_delivery', data),
		//物流详情
		logistics:(data = {}) => vm.$u.post('/shop/Order/logistics', data),
		
		//修改个人信息
		changeInfo:(data = {}) => vm.$u.post('/member/Personal/changeInfo', data),
		//我的收藏
		myCollection:(data = {}) => vm.$u.post('/shop/Collection/myCollection', data),
		//我的足迹
		myFootprint:(data = {}) => vm.$u.post('/shop/Collection/myFootprint', data),

		//朋友圈管理
		myCircle:(data = {}) => vm.$u.post('/moments/Index/myCircle', data),
		//朋友圈删除
		deleteCircle:(data = {}) => vm.$u.post('/moments/Index/deleteCircle', data),
		//视频管理
		myVideo:(data = {}) => vm.$u.post('/video/Index/myVideo', data),
		//视频删除
		deleteVideo:(data = {}) => vm.$u.post('/video/Index/deleteVideo', data),

		// 朋友圈分类
		circleCategory:(data = {}) => vm.$u.post('/moments/Index/circleCategory', data),
		// 朋友圈点击分类显示列表
		circle:(data = {}) => vm.$u.post('/moments/Index/circle', data),
		// 朋友圈下方展示列表
		circleIndex:(data = {}) => vm.$u.post('/moments/Index/index', data),
		// 朋友圈点赞
		give:(data = {}) => vm.$u.post('/moments/Index/give', data),
		// 朋友圈详情
		circleDateils:(data = {}) => vm.$u.post('/moments/Index/circleDateils', data),
		// 朋友圈评论
		comment:(data = {}) => vm.$u.post('/moments/Index/comment', data),
		// 朋友圈轮播图
		circle_index:(data = {}) => vm.$u.post('/shop/index/circle_index', data),
		// 公告
		announce_list:(data = {}) => vm.$u.post('/system/Announce/announce_list', data),
		// 公告详情
		announce_detail:(data = {}) => vm.$u.post('/system/Announce/announce_detail', data),
		//朋友圈公告列表
		article_list:(data = {}) => vm.$u.post('/system/Article/article_list', data),
		//朋友圈公告详情
		article_detail:(data = {}) => vm.$u.post('/system/Article/article_detail', data),
		// 评论点赞
		commentGive:(data = {}) => vm.$u.post('/moments/Index/commentGive', data),
		// 查看评论内容
		viewComments:(data = {}) => vm.$u.post('/moments/Index/viewComments', data),
		// 发布评论
		releaseCircle:(data = {}) => vm.$u.post('/moments/Index/releaseCircle', data),
		
		// 视频列表
		videoList:(data = {}) => vm.$u.post('/video/Index/videoList', data),
		//关注用户列表
		give_list:(data = {}) => vm.$u.post('/video/Index/give_list', data),
		//关注的视频列表
		give_video:(data = {}) => vm.$u.post('video/Index/give_video', data),
		// 视频点赞
		videoGive:(data = {}) => vm.$u.post('/video/Index/give', data),
		// 视频详情
		videoDetails:(data = {}) => vm.$u.post('/video/Index/videoDetails', data),
		// 视频关注
		videoFollow:(data = {}) => vm.$u.post('/video/Index/videoFollow', data),
		// 视频收藏
		collection:(data = {}) => vm.$u.post('/video/Index/collection', data),
		// 发布视频
		releaseVideo:(data = {}) => vm.$u.post('/video/Index/releaseVideo', data),
		// 发布视频选择关联商品
		videoShopGoods:(data = {}) => vm.$u.post('/video/Index/shopGoods', data),
		// 消息列表
		messageList:(data = {}) => vm.$u.post('/system/Article/messageList', data),
		// 消息未读数
		messageCount:(data = {}) => vm.$u.post('/system/Article/messageCount', data),
		
	}
	// // 此处没有使用传入的params参数
	// let getSearch = (data = {}) => vm.$u.get(hotSearchUrl, data);
	
	// // 此处使用了传入的params参数，一切自定义即可
	// let getSearch = (data = {}) => vm.$u.get(hotSearchUrl, data);
	
	// // 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	// vm.$u.api = {getSearch, getInfo};
}
export default {
	install
}
